package route

import (
	"github.com/gin-gonic/gin"
	"nnxy-search-api/search-order-api/api/category"
	"nnxy-search-api/search-order-api/middleware"
)

func InitCategoryRoute(router *gin.RouterGroup) {
	r := router.Group("category")
	{
		r.GET("", category.List) //用户获取分类
		r.GET("/:id", category.Detail).Use(middleware.JwtAuth())
		r.POST("", category.New).Use(middleware.JwtAuth())
		r.PUT("/:id", category.Update).Use(middleware.JwtAuth())
		r.DELETE("/:id", category.Delete).Use(middleware.JwtAuth())
	}
}
